package com.aproj.web;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/createEvent")
public class EventController {

	@RequestMapping(method=RequestMethod.GET)
	public String showCreateEvent(ModelMap map, HttpServletRequest request, HttpServletResponse response){
		
		return "createEvent";
	}
	
	@RequestMapping(method=RequestMethod.POST)
	public void createEvent(HttpServletRequest request, HttpServletResponse response){
		
		try {
			response.sendRedirect(request.getContextPath()+"/main");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
}
